package com.javacore.day4;

public class Calculator {

	public int add(int...a){
		int result = 0;
		for (int i = 0; i < a.length; i++) {
			result += a[i];
		}
		return result;
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Calculator cal = new Calculator();
		System.out.println("Sum of four: " + cal.add(1,3,4,5));
		System.out.println("Sum of five: " + cal.add(1,3,4,5,7));
	}

}
